<template>
  <rx-dialog @handOk="handleSubmit" @cancel="cancel">
    <a-form :form="form">
      <a-form-item style="display:none">
        <a-input v-decorator="['fileId']"/>
      </a-form-item>	  
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.categoryId','分类ID')">
					<a-input :placeholder="i18n('form.categoryId','分类ID')" v-decorator="['typeId', {rules: [{required: false, message: i18n('form.categoryId','分类ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.filename','文件名')">
					<a-input :placeholder="i18n('form.filename','文件名')" v-decorator="['fileName', {rules: [{required: true, message: i18n('form.filename','文件名','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.filenameNew','新文件名')">
					<a-input :placeholder="i18n('form.filenameNew','新文件名')" v-decorator="['newFname', {rules: [{required: false, message: i18n('form.filenameNew','新文件名','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.filePath','文件路径')">
                    <a-textarea :placeholder="i18n('form.filePath','文件路径')" v-decorator="['path', {rules: [{required: true, message: i18n('form.filePath','文件路径','input')}]}]" :rows="4" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.varchar','图片缩略图')">
					<a-input :placeholder="i18n('form.varchar','图片缩略图')" v-decorator="['thumbnail', {rules: [{required: false, message: i18n('form.varchar','图片缩略图','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.extension','扩展名')">
					<a-input :placeholder="i18n('form.extension','扩展名')" v-decorator="['ext', {rules: [{required: false, message: i18n('form.extension','扩展名','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.typeAttachment','附件类型')">
					<a-input :placeholder="i18n('form.typeAttachment','附件类型')" v-decorator="['mineType', {rules: [{required: false, message: i18n('form.typeAttachment','附件类型','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.description','说明')">
                    <a-textarea :placeholder="i18n('form.description','说明')" v-decorator="['desc', {rules: [{required: false, message: i18n('form.description','说明','input')}]}]" :rows="4" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.bytes','总字节数')">
                    <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.bytes','总字节数')" v-decorator="['totalBytes', {rules: [{required: false, message:i18n('form.bytes','总字节数','input')}]}]" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.identity','删除标识')">
					<a-input :placeholder="i18n('form.identity','删除标识')" v-decorator="['delStatus', {rules: [{required: false, message: i18n('form.identity','删除标识','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.module','模块ID')">
					<a-input :placeholder="i18n('form.module','模块ID')" v-decorator="['moduleId', {rules: [{required: false, message: i18n('form.module','模块ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol"  :label="i18n('form.record','记录ID')">
					<a-input :placeholder="i18n('form.record','记录ID')" v-decorator="['recordId', {rules: [{required: false, message: i18n('form.record','记录ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.type','来源类型')">
					<a-input :placeholder="i18n('form.type','来源类型')"  v-decorator="['from', {rules: [{required: false, message:i18n('form.type','来源类型','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :label="i18n('form.status','生成PDF状态')">
					<a-input :placeholder="i18n('form.status','生成PDF状态')" v-decorator="['coverStatus', {rules: [{required: false, message:i18n('form.status','生成PDF状态','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.system','文件系统')">
					<a-input :placeholder="i18n('form.system','文件系统')" v-decorator="['fileSystem', {rules: [{required: false, message:i18n('form.system','文件系统','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.path','PDF文件路径')">
                    <a-textarea :placeholder="i18n('form.path','PDF文件路径')" v-decorator="['pdfPath', {rules: [{required: false, message:i18n('form.path','PDF文件路径','input')}]}]" :rows="4" />
			  </a-form-item>
    </a-form>
  </rx-dialog>
</template>
<script>
  import SysFileApi from '@/api/system/core/sysFile'
  import {BaseForm,RxDialog} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'SysFileEdit',
    mixins:[BaseForm],
    components: {
      RxDialog,
    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"SysFile",key);
        },
      get(id){
        return SysFileApi.get(id);
      },
      save(values){
        return SysFileApi.save(values);
      }

    }
  }
</script>
